#ifndef _ZIASERVERUNIX_H_
#define _ZIASERVERUNIX_H_

#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netdb.h>
#include <signal.h>
#include <iostream>
#include "Connection.hpp"

#define	PORT	10025
#define BUFLEN	4096

class	ServerUnix
{
public :
	ServerUnix();
	~ServerUnix();

	void		LaunchServer();
	void		closeConnection();

private :
	int			HandleListen();
	int			HandleSelect();
	int			NewClient(fd_set *StaticRFdSet, int max);
	std::string	HandleMsg(int checkSock, fd_set *StaticRFdSet, int *max);

	int		_servSock;
	std::string	myBuffer;
};

#endif 
